package ex55.mm.flow.impound.quote.aggregate;

public class ExEdge {
    public enum Type {
        TRADE_BUY,
        TRADE_SELL,
        TRANSFER
    }

    // 交易节点ID
    private String productId;
    // 交易节点标签
    private String label;
    // 资产转换（买，卖，区块链转账）
    private Type type;
    // 源资产
    private String source;
    // 目标资产
    private String target;

    public String getProductId() {
        return productId;
    }

    public ExEdge setProductId(String productId) {
        this.productId = productId;
        return this;
    }

    public String getLabel() {
        return label;
    }

    public ExEdge setLabel(String label) {
        this.label = label;
        return this;
    }

    public ExEdge.Type getType() {
        return type;
    }

    public ExEdge setType(Type type) {
        this.type = type;
        return this;
    }

    public String getSource() {
        return source;
    }

    public ExEdge setSource(String source) {
        this.source = source;
        return this;
    }

    public String getTarget() {
        return target;
    }

    public ExEdge setTarget(String target) {
        this.target = target;
        return this;
    }

    @Override
    public String toString() {
        return "<" + getSource() + "-" + type.name()
                .replace("TRADE_", "")
                .replace("RANSFER", "")
                .replace("UY", "")
                .replace("ELL", "")
                + "->" + getTarget() + ">";
    }
}
